# Contributor: Teran McKinney <sega01@go-beyond.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=jfsutils
pkgver=1.1.15
pkgrel=9
pkgdesc="JFS filesystem utilities"
url="https://jfs.sourceforge.net/"
arch="all"
license="GPL-2.0-or-later"
makedepends="e2fsprogs-dev" # is pulled in externally.
subpackages="$pkgname-doc"
source="https://jfs.sourceforge.net/project/pub/jfsutils-$pkgver.tar.gz
	format-security.patch
	musl-fix-includes.patch
	jfsutils-include-sysmacros.patch
	missing-stdinth.patch
	gcc-10.patch
	fflush-stdout.patch
	gnu-basename.patch
	"

build() {
	./configure \
		--build=$CBUILD \
		--prefix=/usr \
		--host=$CHOST \
		--mandir=/usr/share/man
	make
}

package() {
	make -j1 LDCONFIG=: DESTDIR="$pkgdir" install
}

sha512sums="
fa8ba7f4997471da3e6ea7239564f3395046222cfbb2b10e37b24ad0bd107b7eadbb51ce328d89d193034360b4035ca5e0e5b0b416a74483d7a2c0a2b9c65858  jfsutils-1.1.15.tar.gz
c4930e7dd42a384a2d3b55ee099bba45628253aa367156d1615841bdf7e60c439e571f01e3838e024ceb98cd0d47e842b1ed7924a50c64ad3d825313f7c5cbad  format-security.patch
fb0d7348e2e13a6a9c3a987d161e0cf05363649515366ef49a45e3580b8f6135fce8465b99ff8a351231d970371c00bea6ceb9edb1d0f24da20d261b06ec85bd  musl-fix-includes.patch
dd634072847158520ae1eb1b624884cd4fdf6847c468335d8cb784f82f0fa09814c3756014f373b19fa3a5d19a95128964c2b6a12aac7ea6da6b7714646765d4  jfsutils-include-sysmacros.patch
a8e2332f2dec37affa8404b31e7e68399d815d450422ad342243c51d117e4d7ef4aaa0e30d1389380a81ed076a7ef1e1d41fcf260fa05ce4d823aa779628982d  missing-stdinth.patch
62e1c8c13864e95dd0ef586f98b5d6c7e9b254eb9a1a78faabcc35da187c62abbaaf08da0926203827b10c3baa419523cf2fb55eed059ccd4abfb12acc1b6fb4  gcc-10.patch
2a0b833234fb8e972c1edbd0b2d2927a095727fa188f3d88f4082bac813b8293af19790fc1fac53191064fbee1ddefe781e90e1f64c27f2c5e73c2ee960ad574  fflush-stdout.patch
ad33feb94adf236a57a42a85eb5817cc2e3d3017366fac9167ac5d49cb7b2e57cf130517c8a4b43292fd3d4ec8bcb11df78dcd8ae642c088758a6e3c1a55c91a  gnu-basename.patch
"
